﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="header.aspx.cs" Inherits="pages_header" %>
<div class="navigation-bar fixed-top shadow">
    <div class="navigation-bar-content container">
        <div class="element main-menu">
            <div id="ajax-loading"><img src="assets/images/loading.gif" /></div>
            <a href="#" class="dropdown-toggle no-arrow dropdown-main-menu" >
                <span class="xicon icon-grid-view"></span><span class="text-label">&nbsp;&nbsp;&nbsp;MENU&nbsp;</span> 
            </a>
         </div>
        <span class="element-divider place-right no-desktop"></span>
        <div class="element place-right all-device">
            <a href="#" class="dropdown-toggle no-arrow">
                <span class="icon-cog"></span>
            </a>
            <ul data-role="dropdown" class="dropdown-menu place-right" style="display: none;">
                <li><a href="#" onclick="$('.main-sidebar a[data-formid=\'AHMIDEA-AHMIDEA_AHMIDEAF02\']').click(); return false;">My Profile</a></li>
                <li id="chPassLink"><a href="#" onclick="$('.main-sidebar a[data-formid=\'AHMIDEA-AHMIDEA_AHMIDEAF01\']').click(); return false;">Change Password</a></li>
                <li class="divider"></li>
                <li><a href="#" onclick="_fw_userlogout(); return false;">Logout</a></li>
            </ul>
        </div>
        <span class="element-divider place-right all-device"></span>
        <button class="element image-button image-left place-right all-device" onclick="$('.main-sidebar a[data-formid=\'AHMIDEA-AHMIDEA_AHMIDEAF02\']').click();">
            <span id="userDisplayName" runat="server">...</span> 
            <img src="handlers/imgProfile.ashx" width="40" />
        </button>
    </div>
</div>
<nav class="main-sidebar sidebar light">
    <div class="bg-cyan fg-white main-sidebar-search">
        <div class="input-control text">
            <input type="text"  placeholder="Search...">
            <button class="btn-search"></button>
        </div>
    </div>
    <div class="main-menu-no-result">
        <span class="icon-cancel-2"></span> No data found
    </div>
    <ul class="main-menu-content" id="mainMenuContainer" runat="server">
    </ul>
</nav>
<div style="clear:both; float:none; height:45px;"></div>
<script type="text/javascript">
    $(function () {
        $(".dropdown-main-menu").click(function (e) {
            $(".main-sidebar").slideToggle();
            return false;
        });
        $('<div class="menu-keywords"></div>').appendTo($(".main-menu-content li"));
        $(".main-menu-content li.title[data-group]").each(function (e) {
            var grp = $(this).data('group');
            var obj = $('.menu-keywords', this);
            $(".main-menu-content li[data-group='" + grp + "']:not('.title') a").each(function (e) {
                obj.append($(this).text() + ';');
            });
        });
        $("li[data-group]:not('.title')").each(function () {
            var grp = $(this).data('group');
            var grplabel = $(".main-menu-content li.title[data-group='"+grp+"'] span").text();
            var a = $('a:first', this).text();
            var o = $('li .menu-keywords', this).append(grp + ';' + grplabel + ';' + a + ';');
        });
        $(".main-sidebar .main-sidebar-search input").keyup(function (e) {
            if ($(this).val().length > 0) {
                $('.main-sidebar li:hidden').show();
                $('.main-sidebar li:not(:icontains("' + $(this).val() + '"))').hide();
                $('.main-sidebar [data-role="dropdown"]').show();
            } else {
                $('.main-sidebar li:hidden').show();
                $('.main-sidebar [data-role="dropdown"]').hide()
            }
            if ($('.main-menu-content').height() == 0) {
                $('.main-menu-no-result').show();
            } else { $('.main-menu-no-result').hide(); }
        });
        $('.main-menu-content a[data-formid]').click(function () {
            _fw_formLoad($(this)); _fw_setLocationHash(); $(".main-sidebar").slideUp(); return false;
        });

        //$('.page-tabs .tabs a').mouseup(_fw_setLocationHash);

        // reload opened forms when browser's refresh button pressed
        window.setTimeout(_fw_formLoadFromHash, 10);
    });
</script>
<div id="hdrScript" runat="server"></div>